package com.hopu.v1.service.front.course.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hopu.v1.mapper.front.course.CourseMapper;
import com.hopu.v1.pojo.course.Course;
import com.hopu.v1.service.front.course.CourseService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author admin
* @description 针对表【t_course(课程表)】的数据库操作Service实现
* @createDate 2024-09-25 16:06:13
*/
@Service
public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course>
    implements CourseService {

    @Resource
    private CourseMapper CourseMapper;

    /**
     * 根据pid和status查询课程列表
     * @param pid
     * @param status
     * @return
     */
    @Override
    public List<Course> selectByPidAndStatus(Integer pid, Integer status) {
        return CourseMapper.selectByPidAndStatus(pid,status);
    }

    /**
     * 根据课程id查询课后作业
     * @param id
     * @return
     */
    @Override
    public List<Course> selectByPidAndStatus(Integer id) {
        return CourseMapper.selectHomeworkByCourseId(id);
    }

}




